import { Navigate } from "react-router";
import { lazy } from "react";

const Demo1 = lazy(() => import('../view/demo1'))
const Demo2 = lazy(() => import('../view/demo2'))
const Demo3 = lazy(() => import('../view/demo3'))
const Layout = lazy(() => import('../view/layout'))
const Err = lazy(() => import('../view/err/index'))
const routes = [
    { path: '/', element: <Navigate to='/layout/demo1' /> },
    {
        path: '/layout', element: <Layout />, children: [
            { path: '/layout/demo1', element: <Demo1 /> },
            { path: '/layout/demo2', element: <Demo2 /> },
            { path: '/layout/demo3', element: <Demo3 /> },
        ]
    },
    {
        path: '*',
        element: <Navigate to='/404' />,
    },
    {
        path: '/404',
        element: <Err />
    }

]

export default routes